import { CustomEnum, AuthButtonColumn } from 'custom/index'

export default class ListPageAuthColumn extends AuthButtonColumn {
  public static name: CustomEnum = 'ListPageAuthColumn';

  protected btnId = 0
  useItem(auth: null | string = null) {
    const btn = this.add('PageListAuthButtonInTable', `PageListAuthButtonInTable-${++ this.btnId}`)
    btn.auth(auth)
    btn._props.link = true
    btn._props.type = 'primary'
    return btn
  }
  addItem(auth: null | string = null) {
    this.useItem(auth)
    return this
  }
  end() {
    return this.upto('ListPage')
  }
}
